#include "irobot_abstract.h"
#include <stdbool.h>

void collect_sensor_data(void);

bool left_bumper(void);
bool right_bumper(void);

bool play_button(void);
bool advance_button(void);

unsigned short infrared(void);

unsigned short wall_signal(void);

unsigned char charging_sources(void);

signed short current(void);



//get the most significant byte from a short
unsigned char get_high_byte(short two_bits);
//get the least significant byte from a short
unsigned char get_low_byte(short two_bits);

//stop driving, stop turning
void stop(void);

//drive with the specified wheel velocities
void drive(short right_velocity, short left_velocity);
//returns the number of milliseconds it will take to go
//the specified distance at the given velocity
unsigned int time_to_drive_distance(short velocity, int centimeters);

/*
//drive the specified number of milliseconds at the specified velocitites
void drive_duration(short right_velocity, short left_velocity, int milliseconds);
//drive straight forward or backward with the specified velocity
void drive_direct(short velocity);
//drive in a straight line for the specified distance at the specified speed
void drive_direct_distance(short velocity, int centimeters);
//drive in a straight line for the specified number of milliseconds at the specified speed
void drive_direct_duration(short velocity, int milliseconds);
*/

//rotate in place at the specified linear wheel velocity.  0 is clockwise.  1 is counter clockwise.
void turn_in_place(short velocity, int flag);
//retutns the number of milliseconds it will take to rotate
//the specified number of degrees at the given velocity
unsigned int time_to_rotate_degrees(short velocity, int degrees);

/*
//rotate in place at the specified linear velocity through the specified number of degrees. 0=CW 1=CCW
void turn_in_place_degrees(short velocity, int flag, int degrees);
//rotate in place for the specified number of milliseconds.
//i'm seriously considering not commenting the rest of this.
void turn_in_place_duration(short velocity, int flag, int milliseconds);
//but i'm a tool...
*/

//rotate about a given point (the radius).  radius > 0 is a CCW rotation.  radius < 0 is CW rotation.
//radius = 0 will likely cause the program to barf (but no guarantees since i haven't written the code yet).
//this is because there is no difference between +/-0
void turn_about(short velocity, short radius);
//returns thenumber of milliseconds it will take to turn the specified
//number of degrees at the given velocity and raidus
unsigned int time_to_turn_about_degrees(short velocity, short radius, int degrees);

/*
//ditto, but for the specified number of degrees.
void turn_about_degrees(short velocity, short radius, int degrees);
//ditto, specified time.
void turn_about_duration(short velocity, short radius, int milliseconds);
*/

void leds(bool,bool,unsigned short int,unsigned short int);
